home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / wtj007.zip / BLOOM.ZIP / SWITCH.C < prev    next >
Text File  |  1992-07-24  |  3KB  |  111 lines

  1. // TEMPLATE FOR PARSING WM_CTLCOLOR MESSAGES
  2.  
  3.   case WM_CTLCOLOR:
  4.       type = HIWORD (lParam);
  5.       controlID = GetWindowWord (LOWORD (lParam), GWW_ID) ;
  6.  
  7.       switch (type)
  8.         {
  9.         case CTLCOLOR_DLG:
  10.           return ((DWORD) hBrushBkGnd);
  11.  
  12.         case CTLCOLOR_MSGBOX:
  13.           switch(controlID)
  14.             {
  15.             case XX:
  16.               SetBkMode(wParam, TRANSPARENT);
  17.               SetTextColor(wParam, XX);
  18.               SetBkColor(wParam,XX);
  19.               return ((DWORD) hBrush);
  20.                .
  21.                .
  22.             default:
  23.               SetTextColor(wParam, XX);
  24.               SetBkMode(wParam, TRANSPARENT);
  25.               SetBkColor(wParam,XX);
  26.               return ((DWORD) hBrush);
  27.             }
  28.  
  29.        case CTLCOLOR_EDIT:
  30.           switch(controlID)
  31.             {
  32.             case XX:
  33.               SetBkMode(wParam, TRANSPARENT);
  34.               SetTextColor(wParam, XX);
  35.               SetBkColor(wParam,XX);
  36.               return ((DWORD) hBrush);
  37.                .
  38.                .
  39.             default:
  40.               SetTextColor(wParam, XX);
  41.               SetBkMode(wParam, TRANSPARENT);
  42.               SetBkColor(wParam,XX);
  43.               return ((DWORD) hBrush);
  44.             }
  45.  
  46.         case CTLCOLOR_LISTBOX:
  47.           switch(controlID)
  48.             {
  49.             case XX:
  50.               SetBkMode(wParam, TRANSPARENT);
  51.               SetTextColor(wParam, XX);
  52.               SetBkColor(wParam,XX);
  53.               return ((DWORD) hBrush);
  54.                .
  55.                .
  56.             default:
  57.               SetTextColor(wParam, XX);
  58.               SetBkMode(wParam, TRANSPARENT);
  59.               SetBkColor(wParam,XX);
  60.               return ((DWORD) hBrush);
  61.             }
  62.  
  63.         case CTLCOLOR_BTN:
  64.           switch(controlID)
  65.             {
  66.             case XX:
  67.               SelectObject(wParam,hFont);
  68.               SetTextColor(wParam, XX);
  69.               SetBkMode(wParam, TRANSPARENT);
  70.               return ((DWORD) hBrush);
  71.               .
  72.               .
  73.             default:
  74.               SelectObject(wParam,hFont);
  75.               SetTextColor(wParam, XX);
  76.               SetBkMode(wParam, TRANSPARENT);
  77.               return ((DWORD) hBrush);
  78.             }
  79.  
  80.         case CTLCOLOR_SCROLLBAR:
  81.           switch(controlID)
  82.             {
  83.             case XX:
  84.               return ((DWORD) hBrush);
  85.               .
  86.               .
  87.             default:
  88.             return ((DWORD) hBrush);
  89.             }
  90.  
  91.         case CTLCOLOR_STATIC:
  92.           switch(controlID)
  93.             {
  94.             case XXX:
  95.               SelectObject(wParam,hFont);
  96.               SetBkMode(wParam, TRANSPARENT);
  97.               SetTextColor(wParam, XXX);
  98.               return ((DWORD) hBrush);
  99.               .
  100.               .
  101.             default:
  102.             SelectObject(wParam,hFont);
  103.             SetTextColor(wParam, XX);
  104.             SetBkMode(wParam, TRANSPARENT);
  105.             return ((DWORD) hBrush);
  106.             }
  107.  
  108.         default:
  109.           return ((DWORD) hBrush);
  110.         }
  111.